package org.thread.test04.demo10.homework.demo01;

/**
 * @author CSY
 * @date 2025 - 03 - 11
 */
public class MyThread extends Thread{
    @Override
    public void run() {
        while(true){
            System.out.println("数据采集中...");
            boolean flag = Thread.currentThread().isInterrupted();
            if (flag){
                System.out.println("收尾工作执行...");
                break;
            }
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
        }
    }
}
